package com.dodock.android.banglapapers;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class Utility {
	public static boolean isEmailAddressValid(String emailAddress) {
		String regExpn = "^(([\\w-]+\\.)+[\\w-]+|([a-zA-Z]{1}|[\\w-]{2,}))@"
				+ "((([0-1]?[0-9]{1,2}|25[0-5]|2[0-4][0-9])\\.([0-1]?"
				+ "[0-9]{1,2}|25[0-5]|2[0-4][0-9])\\."
				+ "([0-1]?[0-9]{1,2}|25[0-5]|2[0-4][0-9])\\.([0-1]?"
				+ "[0-9]{1,2}|25[0-5]|2[0-4][0-9])){1}|"
				+ "([a-zA-Z]+[\\w-]+\\.)+[a-zA-Z]{2,4})$";

		Pattern patternObj = Pattern.compile(regExpn);

		Matcher matcherObj = patternObj.matcher(emailAddress);
		if (matcherObj.matches()) {
			return true;
		} else {
			return false;
		}
	}
	public static boolean isOnlyEngCharacters(String txt){		
		if(Pattern.matches("^[a-zA-Z0-9. ]*$", txt))
		{
			return true;
		}		 
		return false;
	}
}
